home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-04-05 | 4.3 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Sun Apr 5 17:17:42 1992, modified Sun Apr 5 17:17:42 1992, creator 'MPS ', type ASCII, 3690 bytes "dbminit.c" , at 0xeea 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 64 62 6d 69 6e 69 | 74 2e 63 00 00 00 00 00 |..dbmini|t.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 0e 6a 00 | 00 01 ac a6 05 1e f6 a6 |......j.|........|
|00000060| 05 1e f6 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 7a 39 00 00 |........|....z9..|
|00000080| 2f 2a 20 64 62 6d 69 6e | 69 74 2e 63 20 2d 20 4f |/* dbmin|it.c - O|
|00000090| 70 65 6e 20 74 68 65 20 | 66 69 6c 65 20 66 6f 72 |pen the |file for|
|000000a0| 20 64 62 6d 20 6f 70 65 | 72 61 74 69 6f 6e 73 2e | dbm ope|rations.|
|000000b0| 20 54 68 69 73 20 6c 6f | 6f 6b 73 20 6c 69 6b 65 | This lo|oks like|
|000000c0| 20 74 68 65 0d 20 20 20 | 44 42 4d 20 69 6e 74 65 | the. |DBM inte|
|000000d0| 72 66 61 63 65 2e 20 2a | 2f 0d 0d 2f 2a 20 20 54 |rface. *|/../* T|
|000000e0| 68 69 73 20 66 69 6c 65 | 20 69 73 20 70 61 72 74 |his file| is part|
|000000f0| 20 6f 66 20 47 44 42 4d | 2c 20 74 68 65 20 47 4e | of GDBM|, the GN|
|00000100| 55 20 64 61 74 61 20 62 | 61 73 65 20 6d 61 6e 61 |U data b|ase mana|
|00000110| 67 65 72 2c 20 62 79 20 | 50 68 69 6c 69 70 20 41 |ger, by |Philip A|
|00000120| 2e 20 4e 65 6c 73 6f 6e | 2e 0d 20 20 20 20 43 6f |. Nelson|.. Co|
|00000130| 70 79 72 69 67 68 74 20 | 28 43 29 20 31 39 39 30 |pyright |(C) 1990|
|00000140| 2c 20 31 39 39 31 20 20 | 46 72 65 65 20 53 6f 66 |, 1991 |Free Sof|
|00000150| 74 77 61 72 65 20 46 6f | 75 6e 64 61 74 69 6f 6e |tware Fo|undation|
|00000160| 2c 20 49 6e 63 2e 0d 0d | 20 20 20 20 47 44 42 4d |, Inc...| GDBM|
|00000170| 20 69 73 20 66 72 65 65 | 20 73 6f 66 74 77 61 72 | is free| softwar|
|00000180| 65 3b 20 79 6f 75 20 63 | 61 6e 20 72 65 64 69 73 |e; you c|an redis|
|00000190| 74 72 69 62 75 74 65 20 | 69 74 20 61 6e 64 2f 6f |tribute |it and/o|
|000001a0| 72 20 6d 6f 64 69 66 79 | 0d 20 20 20 20 69 74 20 |r modify|. it |
|000001b0| 75 6e 64 65 72 20 74 68 | 65 20 74 65 72 6d 73 20 |under th|e terms |
|000001c0| 6f 66 20 74 68 65 20 47 | 4e 55 20 47 65 6e 65 72 |of the G|NU Gener|
|000001d0| 61 6c 20 50 75 62 6c 69 | 63 20 4c 69 63 65 6e 73 |al Publi|c Licens|
|000001e0| 65 20 61 73 20 70 75 62 | 6c 69 73 68 65 64 20 62 |e as pub|lished b|
|000001f0| 79 0d 20 20 20 20 74 68 | 65 20 46 72 65 65 20 53 |y. th|e Free S|
|00000200| 6f 66 74 77 61 72 65 20 | 46 6f 75 6e 64 61 74 69 |oftware |Foundati|
|00000210| 6f 6e 3b 20 65 69 74 68 | 65 72 20 76 65 72 73 69 |on; eith|er versi|
|00000220| 6f 6e 20 31 2c 20 6f 72 | 20 28 61 74 20 79 6f 75 |on 1, or| (at you|
|00000230| 72 20 6f 70 74 69 6f 6e | 29 0d 20 20 20 20 61 6e |r option|). an|
|00000240| 79 20 6c 61 74 65 72 20 | 76 65 72 73 69 6f 6e 2e |y later |version.|
|00000250| 0d 0d 20 20 20 20 47 44 | 42 4d 20 69 73 20 64 69 |.. GD|BM is di|
|00000260| 73 74 72 69 62 75 74 65 | 64 20 69 6e 20 74 68 65 |stribute|d in the|
|00000270| 20 68 6f 70 65 20 74 68 | 61 74 20 69 74 20 77 69 | hope th|at it wi|
|00000280| 6c 6c 20 62 65 20 75 73 | 65 66 75 6c 2c 0d 20 20 |ll be us|eful,. |
|00000290| 20 20 62 75 74 20 57 49 | 54 48 4f 55 54 20 41 4e | but WI|THOUT AN|
|000002a0| 59 20 57 41 52 52 41 4e | 54 59 3b 20 77 69 74 68 |Y WARRAN|TY; with|
|000002b0| 6f 75 74 20 65 76 65 6e | 20 74 68 65 20 69 6d 70 |out even| the imp|
|000002c0| 6c 69 65 64 20 77 61 72 | 72 61 6e 74 79 20 6f 66 |lied war|ranty of|
|000002d0| 0d 20 20 20 20 4d 45 52 | 43 48 41 4e 54 41 42 49 |. MER|CHANTABI|
|000002e0| 4c 49 54 59 20 6f 72 20 | 46 49 54 4e 45 53 53 20 |LITY or |FITNESS |
|000002f0| 46 4f 52 20 41 20 50 41 | 52 54 49 43 55 4c 41 52 |FOR A PA|RTICULAR|
|00000300| 20 50 55 52 50 4f 53 45 | 2e 20 20 53 65 65 20 74 | PURPOSE|. See t|
|00000310| 68 65 0d 20 20 20 20 47 | 4e 55 20 47 65 6e 65 72 |he. G|NU Gener|
|00000320| 61 6c 20 50 75 62 6c 69 | 63 20 4c 69 63 65 6e 73 |al Publi|c Licens|
|00000330| 65 20 66 6f 72 20 6d 6f | 72 65 20 64 65 74 61 69 |e for mo|re detai|
|00000340| 6c 73 2e 0d 0d 20 20 20 | 20 59 6f 75 20 73 68 6f |ls... | You sho|
|00000350| 75 6c 64 20 68 61 76 65 | 20 72 65 63 65 69 76 65 |uld have| receive|
|00000360| 64 20 61 20 63 6f 70 79 | 20 6f 66 20 74 68 65 20 |d a copy| of the |
|00000370| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|00000380| 69 63 20 4c 69 63 65 6e | 73 65 0d 20 20 20 20 61 |ic Licen|se. a|
|00000390| 6c 6f 6e 67 20 77 69 74 | 68 20 47 44 42 4d 3b 20 |long wit|h GDBM; |
|000003a0| 73 65 65 20 74 68 65 20 | 66 69 6c 65 20 43 4f 50 |see the |file COP|
|000003b0| 59 49 4e 47 2e 20 20 49 | 66 20 6e 6f 74 2c 20 77 |YING. I|f not, w|
|000003c0| 72 69 74 65 20 74 6f 0d | 20 20 20 20 74 68 65 20 |rite to.| the |
|000003d0| 46 72 65 65 20 53 6f 66 | 74 77 61 72 65 20 46 6f |Free Sof|tware Fo|
|000003e0| 75 6e 64 61 74 69 6f 6e | 2c 20 36 37 35 20 4d 61 |undation|, 675 Ma|
|000003f0| 73 73 20 41 76 65 2c 20 | 43 61 6d 62 72 69 64 67 |ss Ave, |Cambridg|
|00000400| 65 2c 20 4d 41 20 30 32 | 31 33 39 2c 20 55 53 41 |e, MA 02|139, USA|
|00000410| 2e 0d 0d 20 20 20 20 59 | 6f 75 20 6d 61 79 20 63 |... Y|ou may c|
|00000420| 6f 6e 74 61 63 74 20 74 | 68 65 20 61 75 74 68 6f |ontact t|he autho|
|00000430| 72 20 62 79 3a 0d 20 20 | 20 20 20 20 20 65 2d 6d |r by:. | e-m|
|00000440| 61 69 6c 3a 20 20 70 68 | 69 6c 40 63 73 2e 77 77 |ail: ph|il@cs.ww|
|00000450| 75 2e 65 64 75 0d 20 20 | 20 20 20 20 75 73 2d 6d |u.edu. | us-m|
|00000460| 61 69 6c 3a 20 20 50 68 | 69 6c 69 70 20 41 2e 20 |ail: Ph|ilip A. |
|00000470| 4e 65 6c 73 6f 6e 0d 20 | 20 20 20 20 20 20 20 20 |Nelson. | |
|00000480| 20 20 20 20 20 20 20 43 | 6f 6d 70 75 74 65 72 20 | C|omputer |
|00000490| 53 63 69 65 6e 63 65 20 | 44 65 70 61 72 74 6d 65 |Science |Departme|
|000004a0| 6e 74 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |nt. | |
|000004b0| 20 20 20 57 65 73 74 65 | 72 6e 20 57 61 73 68 69 | Weste|rn Washi|
|000004c0| 6e 67 74 6f 6e 20 55 6e | 69 76 65 72 73 69 74 79 |ngton Un|iversity|
|000004d0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000004e0| 20 42 65 6c 6c 69 6e 67 | 68 61 6d 2c 20 57 41 20 | Belling|ham, WA |
|000004f0| 39 38 32 32 36 0d 20 20 | 20 20 20 20 20 20 70 68 |98226. | ph|
|00000500| 6f 6e 65 3a 20 20 28 32 | 30 36 29 20 36 37 36 2d |one: (2|06) 676-|
|00000510| 33 30 33 35 0d 20 20 20 | 20 20 20 20 0d 2a 2a 2a |3035. | .***|
|00000520| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000530| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000540| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000550| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000560| 2a 2a 2a 2a 2a 2a 2f 0d | 0d 0d 23 69 6e 63 6c 75 |******/.|..#inclu|
|00000570| 64 65 20 22 67 64 62 6d | 64 65 66 73 2e 68 22 0d |de "gdbm|defs.h".|
|00000580| 23 69 6e 63 6c 75 64 65 | 20 22 67 64 62 6d 65 72 |#include| "gdbmer|
|00000590| 72 6e 6f 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |rno.h".#|include |
|000005a0| 22 65 78 74 65 72 6e 2e | 68 22 0d 0d 65 78 74 65 |"extern.|h"..exte|
|000005b0| 72 6e 20 67 64 62 6d 5f | 65 72 72 6f 72 20 67 64 |rn gdbm_|error gd|
|000005c0| 62 6d 5f 65 72 72 6e 6f | 3b 0d 0d 2f 2a 20 49 6e |bm_errno|;../* In|
|000005d0| 69 74 69 61 6c 69 7a 65 | 20 64 62 6d 20 73 79 73 |itialize| dbm sys|
|000005e0| 74 65 6d 2e 20 20 46 49 | 4c 45 20 69 73 20 61 20 |tem. FI|LE is a |
|000005f0| 70 6f 69 6e 74 65 72 20 | 74 6f 20 74 68 65 20 66 |pointer |to the f|
|00000600| 69 6c 65 20 6e 61 6d 65 | 2e 20 20 49 6e 0d 20 20 |ile name|. In. |
|00000610| 20 73 74 61 6e 64 61 72 | 64 20 64 62 6d 2c 20 74 | standar|d dbm, t|
|00000620| 68 65 20 64 61 74 61 62 | 61 73 65 20 69 73 20 66 |he datab|ase is f|
|00000630| 6f 75 6e 64 20 69 6e 20 | 66 69 6c 65 73 20 63 61 |ound in |files ca|
|00000640| 6c 6c 65 64 20 46 49 4c | 45 2e 70 61 67 20 61 6e |lled FIL|E.pag an|
|00000650| 64 0d 20 20 20 46 49 4c | 45 2e 64 69 72 2e 20 20 |d. FIL|E.dir. |
|00000660| 54 6f 20 6d 61 6b 65 20 | 67 64 62 6d 20 63 6f 6d |To make |gdbm com|
|00000670| 70 61 74 61 62 6c 65 20 | 77 69 74 68 20 64 62 6d |patable |with dbm|
|00000680| 20 75 73 69 6e 67 20 74 | 68 65 20 64 62 6d 69 6e | using t|he dbmin|
|00000690| 69 74 20 63 61 6c 6c 2c | 0d 20 20 20 74 68 65 20 |it call,|. the |
|000006a0| 73 61 6d 65 20 66 69 6c | 65 20 6e 61 6d 65 73 20 |same fil|e names |
|000006b0| 61 72 65 20 75 73 65 64 | 2e 20 20 53 70 65 63 69 |are used|. Speci|
|000006c0| 66 69 63 61 6c 6c 79 2c | 20 64 62 6d 69 6e 69 74 |fically,| dbminit|
|000006d0| 20 77 69 6c 6c 20 75 73 | 65 20 74 68 65 20 66 69 | will us|e the fi|
|000006e0| 6c 65 0d 20 20 20 6e 61 | 6d 65 20 46 49 4c 45 2e |le. na|me FILE.|
|000006f0| 70 61 67 20 69 6e 20 69 | 74 73 20 63 61 6c 6c 20 |pag in i|ts call |
|00000700| 74 6f 20 67 64 62 6d 20 | 6f 70 65 6e 2e 20 20 49 |to gdbm |open. I|
|00000710| 66 20 74 68 65 20 66 69 | 6c 65 20 28 46 49 4c 45 |f the fi|le (FILE|
|00000720| 2e 70 61 67 29 20 68 61 | 73 20 61 0d 20 20 20 73 |.pag) ha|s a. s|
|00000730| 69 7a 65 20 6f 66 20 7a | 65 72 6f 20 62 79 74 65 |ize of z|ero byte|
|00000740| 73 2c 20 61 20 66 69 6c | 65 20 69 6e 69 74 69 61 |s, a fil|e initia|
|00000750| 6c 69 7a 61 74 69 6f 6e | 20 70 72 6f 63 65 64 75 |lization| procedu|
|00000760| 72 65 20 69 73 20 70 65 | 72 66 6f 72 6d 65 64 2c |re is pe|rformed,|
|00000770| 0d 20 20 20 73 65 74 74 | 69 6e 67 20 75 70 20 74 |. sett|ing up t|
|00000780| 68 65 20 69 6e 69 74 69 | 61 6c 20 73 74 72 75 63 |he initi|al struc|
|00000790| 74 75 72 65 20 69 6e 20 | 74 68 65 20 66 69 6c 65 |ture in |the file|
|000007a0| 2e 20 20 41 6e 79 20 65 | 72 72 6f 72 20 64 65 74 |. Any e|rror det|
|000007b0| 65 63 74 65 64 20 77 69 | 6c 6c 0d 20 20 20 63 61 |ected wi|ll. ca|
|000007c0| 75 73 65 20 61 20 72 65 | 74 75 72 6e 20 76 61 6c |use a re|turn val|
|000007d0| 75 65 20 6f 66 20 2d 31 | 2e 20 20 4e 6f 20 65 72 |ue of -1|. No er|
|000007e0| 72 6f 72 73 20 63 61 75 | 73 65 20 74 68 65 20 72 |rors cau|se the r|
|000007f0| 65 74 75 72 6e 20 76 61 | 6c 75 65 20 6f 66 20 30 |eturn va|lue of 0|
|00000800| 2e 0d 20 20 20 4e 4f 54 | 45 3a 20 66 69 6c 65 2e |.. NOT|E: file.|
|00000810| 64 69 72 20 77 69 6c 6c | 20 62 65 20 6c 69 6e 6b |dir will| be link|
|00000820| 65 64 20 74 6f 20 66 69 | 6c 65 2e 70 61 67 2e 20 |ed to fi|le.pag. |
|00000830| 2a 2f 0d 0d 69 6e 74 0d | 64 62 6d 69 6e 69 74 20 |*/..int.|dbminit |
|00000840| 28 66 69 6c 65 29 0d 20 | 20 20 20 20 63 68 61 72 |(file). | char|
|00000850| 20 2a 66 69 6c 65 3b 0d | 7b 0d 20 20 63 68 61 72 | *file;.|{. char|
|00000860| 2a 20 70 61 67 5f 66 69 | 6c 65 3b 09 20 20 20 20 |* pag_fi|le;. |
|00000870| 2f 2a 20 55 73 65 64 20 | 74 6f 20 63 6f 6e 73 74 |/* Used |to const|
|00000880| 72 75 63 74 20 22 66 69 | 6c 65 2e 70 61 67 22 2e |ruct "fi|le.pag".|
|00000890| 20 2a 2f 0d 20 20 63 68 | 61 72 2a 20 64 69 72 5f | */. ch|ar* dir_|
|000008a0| 66 69 6c 65 3b 09 20 20 | 20 20 2f 2a 20 55 73 65 |file;. | /* Use|
|000008b0| 64 20 74 6f 20 63 6f 6e | 73 74 72 75 63 74 20 22 |d to con|struct "|
|000008c0| 66 69 6c 65 2e 64 69 72 | 22 2e 20 2a 2f 0d 20 20 |file.dir|". */. |
|000008d0| 73 74 72 75 63 74 20 73 | 74 61 74 20 64 69 72 5f |struct s|tat dir_|
|000008e0| 73 74 61 74 3b 09 20 20 | 20 20 2f 2a 20 53 74 61 |stat;. | /* Sta|
|000008f0| 74 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 66 6f |t inform|ation fo|
|00000900| 72 20 22 66 69 6c 65 2e | 64 69 72 22 2e 20 2a 2f |r "file.|dir". */|
|00000910| 0d 0d 0d 20 20 2f 2a 20 | 50 72 65 70 61 72 65 20 |... /* |Prepare |
|00000920| 74 68 65 20 63 6f 72 72 | 65 63 74 20 6e 61 6d 65 |the corr|ect name|
|00000930| 73 20 6f 66 20 22 66 69 | 6c 65 2e 70 61 67 22 20 |s of "fi|le.pag" |
|00000940| 61 6e 64 20 22 66 69 6c | 65 2e 64 69 72 22 2e 20 |and "fil|e.dir". |
|00000950| 2a 2f 0d 20 20 70 61 67 | 5f 66 69 6c 65 20 3d 20 |*/. pag|_file = |
|00000960| 28 63 68 61 72 20 2a 29 | 20 61 6c 6c 6f 63 61 20 |(char *)| alloca |
|00000970| 28 73 74 72 6c 65 6e 20 | 28 66 69 6c 65 29 2b 35 |(strlen |(file)+5|
|00000980| 29 3b 0d 20 20 64 69 72 | 5f 66 69 6c 65 20 3d 20 |);. dir|_file = |
|00000990| 28 63 68 61 72 20 2a 29 | 20 61 6c 6c 6f 63 61 20 |(char *)| alloca |
|000009a0| 28 73 74 72 6c 65 6e 20 | 28 66 69 6c 65 29 2b 35 |(strlen |(file)+5|
|000009b0| 29 3b 0d 0d 20 20 73 74 | 72 63 70 79 20 28 70 61 |);.. st|rcpy (pa|
|000009c0| 67 5f 66 69 6c 65 2c 20 | 66 69 6c 65 29 3b 0d 20 |g_file, |file);. |
|000009d0| 20 73 74 72 63 61 74 20 | 28 70 61 67 5f 66 69 6c | strcat |(pag_fil|
|000009e0| 65 2c 20 22 2e 70 61 67 | 22 29 3b 0d 20 20 73 74 |e, ".pag|");. st|
|000009f0| 72 63 70 79 20 28 64 69 | 72 5f 66 69 6c 65 2c 20 |rcpy (di|r_file, |
|00000a00| 66 69 6c 65 29 3b 0d 20 | 20 73 74 72 63 61 74 20 |file);. | strcat |
|00000a10| 28 64 69 72 5f 66 69 6c | 65 2c 20 22 2e 64 69 72 |(dir_fil|e, ".dir|
|00000a20| 22 29 3b 0d 0d 20 20 69 | 66 20 28 5f 67 64 62 6d |");.. i|f (_gdbm|
|00000a30| 5f 66 69 6c 65 20 21 3d | 20 4e 55 4c 4c 29 0d 20 |_file !=| NULL). |
|00000a40| 20 20 20 67 64 62 6d 5f | 63 6c 6f 73 65 20 28 5f | gdbm_|close (_|
|00000a50| 67 64 62 6d 5f 66 69 6c | 65 29 3b 0d 0d 20 20 2f |gdbm_fil|e);.. /|
|00000a60| 2a 20 54 72 79 20 74 6f | 20 6f 70 65 6e 20 74 68 |* Try to| open th|
|00000a70| 65 20 66 69 6c 65 20 61 | 73 20 61 20 77 72 69 74 |e file a|s a writ|
|00000a80| 65 72 2e 20 20 44 42 4d | 20 6e 65 76 65 72 20 63 |er. DBM| never c|
|00000a90| 72 65 61 74 65 64 20 61 | 20 66 69 6c 65 2e 20 2a |reated a| file. *|
|00000aa0| 2f 0d 20 20 5f 67 64 62 | 6d 5f 66 69 6c 65 20 3d |/. _gdb|m_file =|
|00000ab0| 20 67 64 62 6d 5f 6f 70 | 65 6e 20 28 70 61 67 5f | gdbm_op|en (pag_|
|00000ac0| 66 69 6c 65 2c 20 30 2c | 20 47 44 42 4d 5f 57 52 |file, 0,| GDBM_WR|
|00000ad0| 49 54 45 52 2c 20 30 2c | 20 4e 55 4c 4c 29 3b 0d |ITER, 0,| NULL);.|
|00000ae0| 0d 20 20 2f 2a 20 49 66 | 20 69 74 20 77 61 73 20 |. /* If| it was |
|00000af0| 6e 6f 74 20 6f 70 65 6e | 65 64 2c 20 74 72 79 20 |not open|ed, try |
|00000b00| 6f 70 65 6e 69 6e 67 20 | 69 74 20 61 73 20 61 20 |opening |it as a |
|00000b10| 72 65 61 64 65 72 2e 20 | 2a 2f 0d 20 20 69 66 20 |reader. |*/. if |
|00000b20| 28 5f 67 64 62 6d 5f 66 | 69 6c 65 20 3d 3d 20 4e |(_gdbm_f|ile == N|
|00000b30| 55 4c 4c 29 0d 20 20 20 | 20 7b 0d 20 20 20 20 20 |ULL). | {. |
|00000b40| 20 5f 67 64 62 6d 5f 66 | 69 6c 65 20 3d 20 67 64 | _gdbm_f|ile = gd|
|00000b50| 62 6d 5f 6f 70 65 6e 20 | 28 70 61 67 5f 66 69 6c |bm_open |(pag_fil|
|00000b60| 65 2c 20 30 2c 20 47 44 | 42 4d 5f 52 45 41 44 45 |e, 0, GD|BM_READE|
|00000b70| 52 2c 20 30 2c 20 4e 55 | 4c 4c 29 3b 0d 20 20 0d |R, 0, NU|LL);. .|
|00000b80| 20 20 20 20 20 20 2f 2a | 20 44 69 64 20 77 65 20 | /*| Did we |
|00000b90| 73 75 63 63 65 73 73 66 | 75 6c 6c 79 20 6f 70 65 |successf|ully ope|
|00000ba0| 6e 20 74 68 65 20 66 69 | 6c 65 3f 20 2a 2f 0d 20 |n the fi|le? */. |
|00000bb0| 20 20 20 20 20 69 66 20 | 28 5f 67 64 62 6d 5f 66 | if |(_gdbm_f|
|00000bc0| 69 6c 65 20 3d 3d 20 4e | 55 4c 4c 29 0d 09 7b 0d |ile == N|ULL)..{.|
|00000bd0| 09 20 20 67 64 62 6d 5f | 65 72 72 6e 6f 20 3d 20 |. gdbm_|errno = |
|00000be0| 47 44 42 4d 5f 46 49 4c | 45 5f 4f 50 45 4e 5f 45 |GDBM_FIL|E_OPEN_E|
|00000bf0| 52 52 4f 52 3b 0d 09 20 | 20 72 65 74 75 72 6e 20 |RROR;.. | return |
|00000c00| 2d 31 3b 0d 09 7d 0d 20 | 20 20 20 7d 0d 0d 23 69 |-1;..}. | }..#i|
|00000c10| 66 64 65 66 20 6d 61 63 | 69 6e 74 6f 73 68 0d 20 |fdef mac|intosh. |
|00000c20| 20 2f 2a 20 44 6f 6e 27 | 74 20 62 6f 74 68 65 72 | /* Don'|t bother|
|00000c30| 20 77 69 74 68 20 6d 69 | 6e 6f 72 20 63 6f 6d 70 | with mi|nor comp|
|00000c40| 61 74 69 62 69 6c 69 74 | 79 20 64 65 74 61 69 6c |atibilit|y detail|
|00000c50| 73 20 2a 2f 0d 23 65 6c | 73 65 0d 20 20 2f 2a 20 |s */.#el|se. /* |
|00000c60| 49 66 20 74 68 65 20 64 | 61 74 61 62 61 73 65 20 |If the d|atabase |
|00000c70| 69 73 20 6e 65 77 2c 20 | 6c 69 6e 6b 20 22 66 69 |is new, |link "fi|
|00000c80| 6c 65 2e 64 69 72 22 20 | 74 6f 20 22 66 69 6c 65 |le.dir" |to "file|
|00000c90| 2e 70 61 67 22 2e 20 54 | 68 69 73 20 69 73 20 64 |.pag". T|his is d|
|00000ca0| 6f 6e 65 0d 20 20 20 20 | 20 73 6f 20 74 68 65 20 |one. | so the |
|00000cb0| 74 69 6d 65 20 73 74 61 | 6d 70 20 6f 6e 20 62 6f |time sta|mp on bo|
|00000cc0| 74 68 20 66 69 6c 65 73 | 20 69 73 20 74 68 65 20 |th files| is the |
|00000cd0| 73 61 6d 65 2e 20 2a 2f | 0d 20 20 69 66 20 28 73 |same. */|. if (s|
|00000ce0| 74 61 74 20 28 64 69 72 | 5f 66 69 6c 65 2c 20 26 |tat (dir|_file, &|
|00000cf0| 64 69 72 5f 73 74 61 74 | 29 20 3d 3d 20 30 29 0d |dir_stat|) == 0).|
|00000d00| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 69 66 20 28 | {. | if (|
|00000d10| 64 69 72 5f 73 74 61 74 | 2e 73 74 5f 73 69 7a 65 |dir_stat|.st_size|
|00000d20| 20 3d 3d 20 30 29 0d 09 | 69 66 20 28 75 6e 6c 69 | == 0)..|if (unli|
|00000d30| 6e 6b 20 28 64 69 72 5f | 66 69 6c 65 29 20 21 3d |nk (dir_|file) !=|
|00000d40| 20 30 20 7c 7c 20 6c 69 | 6e 6b 20 28 70 61 67 5f | 0 || li|nk (pag_|
|00000d50| 66 69 6c 65 2c 20 64 69 | 72 5f 66 69 6c 65 29 20 |file, di|r_file) |
|00000d60| 21 3d 20 30 29 0d 09 20 | 20 7b 0d 09 20 20 20 20 |!= 0).. | {.. |
|00000d70| 67 64 62 6d 5f 65 72 72 | 6e 6f 20 3d 20 47 44 42 |gdbm_err|no = GDB|
|00000d80| 4d 5f 46 49 4c 45 5f 4f | 50 45 4e 5f 45 52 52 4f |M_FILE_O|PEN_ERRO|
|00000d90| 52 3b 0d 09 20 20 20 20 | 67 64 62 6d 5f 63 6c 6f |R;.. |gdbm_clo|
|00000da0| 73 65 20 28 5f 67 64 62 | 6d 5f 66 69 6c 65 29 3b |se (_gdb|m_file);|
|00000db0| 0d 09 20 20 20 20 72 65 | 74 75 72 6e 20 2d 31 3b |.. re|turn -1;|
|00000dc0| 0d 09 20 20 7d 0d 20 20 | 20 20 7d 0d 20 20 65 6c |.. }. | }. el|
|00000dd0| 73 65 0d 20 20 20 20 7b | 0d 20 20 20 20 20 20 2f |se. {|. /|
|00000de0| 2a 20 53 69 6e 63 65 20 | 77 65 20 63 61 6e 27 74 |* Since |we can't|
|00000df0| 20 73 74 61 74 20 69 74 | 2c 20 77 65 20 61 73 73 | stat it|, we ass|
|00000e00| 75 6d 65 20 69 74 20 69 | 73 20 6e 6f 74 20 74 68 |ume it i|s not th|
|00000e10| 65 72 65 20 61 6e 64 20 | 74 72 79 0d 20 20 20 20 |ere and |try. |
|00000e20| 20 20 20 20 20 74 6f 20 | 6c 69 6e 6b 20 74 68 65 | to |link the|
|00000e30| 20 64 69 72 5f 66 69 6c | 65 20 74 6f 20 74 68 65 | dir_fil|e to the|
|00000e40| 20 70 61 67 5f 66 69 6c | 65 2e 20 2a 2f 0d 20 20 | pag_fil|e. */. |
|00000e50| 20 20 20 20 69 66 20 28 | 6c 69 6e 6b 20 28 70 61 | if (|link (pa|
|00000e60| 67 5f 66 69 6c 65 2c 20 | 64 69 72 5f 66 69 6c 65 |g_file, |dir_file|
|00000e70| 29 20 21 3d 20 30 29 0d | 09 7b 0d 09 20 20 67 64 |) != 0).|.{.. gd|
|00000e80| 62 6d 5f 65 72 72 6e 6f | 20 3d 20 47 44 42 4d 5f |bm_errno| = GDBM_|
|00000e90| 46 49 4c 45 5f 4f 50 45 | 4e 5f 45 52 52 4f 52 3b |FILE_OPE|N_ERROR;|
|00000ea0| 0d 09 20 20 67 64 62 6d | 5f 63 6c 6f 73 65 20 28 |.. gdbm|_close (|
|00000eb0| 5f 67 64 62 6d 5f 66 69 | 6c 65 29 3b 0d 09 20 20 |_gdbm_fi|le);.. |
|00000ec0| 72 65 74 75 72 6e 20 2d | 31 3b 0d 09 7d 0d 20 20 |return -|1;..}. |
|00000ed0| 20 20 7d 0d 23 65 6e 64 | 69 66 0d 0d 20 20 72 65 | }.#end|if.. re|
|00000ee0| 74 75 72 6e 20 30 3b 0d | 7d 0d 00 00 00 00 00 00 |turn 0;.|}.......|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00000f10| 6c 20 6f 74 68 65 72 20 | 63 68 61 72 61 63 74 65 |l other |characte|
|00000f20| 72 73 2e 0d 09 22 c9 22 | 20 09 09 09 44 6f 75 62 |rs..."."| ...Doub|
|00000f30| 09 64 62 6d 69 6e 69 74 | 2e 63 02 00 00 00 54 45 |.dbminit|.c....TE|
|00000f40| 58 54 4d 50 53 20 00 00 | 00 00 00 00 00 00 00 00 |XTMPS ..|........|
|00000f50| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 00 |..TEXTMP|S ......|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f70| 00 00 a6 04 08 28 00 00 | 0e 6a 00 00 01 ac 61 72 |.....(..|.j....ar|
|00000f80| 61 63 74 65 72 73 20 65 | 78 63 65 70 74 20 b6 2c |acters e|xcept .,|
|00000f90| 20 7b 2c 20 61 6e 64 20 | 60 2e 0d 09 5c c9 5c 20 | {, and |`...\.\ |
|00000fa0| 09 09 09 42 61 63 6b 73 | 6c 61 73 68 20 71 75 6f |...Backs|lash quo|
|00000fb0| 74 65 73 20 61 6c 6c 20 | 63 68 61 72 61 63 74 65 |tes all |characte|
|00000fc0| 72 73 20 65 78 63 65 70 | 74 20 b6 2c 20 7b 2c 20 |rs excep|t ., {, |
|00000fd0| 61 6e 64 20 60 2e 0d 0d | 09 7b c9 7d 20 09 09 09 |and `...|.{.} ...|
|00000fe0| 42 72 61 63 65 73 20 64 | 65 6e 6f 74 65 20 76 61 |Braces d|enote va|
|00000ff0| 72 69 61 62 6c 65 20 73 | 75 62 73 74 69 74 75 74 |riable s|ubstitut|
|00001000| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 ff 00 20 |...H..Mo|naco... |
|00001010| 00 00 00 14 00 06 28 ac | 00 0a 00 50 00 20 00 50 |......(.|...P. .P|
|00001020| 00 20 00 00 00 00 00 06 | 00 08 00 50 00 20 01 dd |. ......|...P. ..|
|00001030| 02 3d 00 50 00 20 01 dd | 02 3d a6 04 e6 b6 00 00 |.=.P. ..|.=......|
|00001040| 0b 95 00 00 0b 9e 00 00 | 0b 8e 01 00 00 00 00 1e |........|........|
|00001050| 00 50 00 20 01 dd 02 3d | 00 50 00 20 01 dd 02 3d |.P. ...=|.P. ...=|
|00001060| 00 00 0b 8e 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001070| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 49 |.....n..|.n...>.I|
|00001080| aa 38 13 1a 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.8......|.>..MPSR|
|00001090| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|000010a0| 03 f0 ff ff 00 00 00 4c | 00 4f dd ac 00 00 00 00 |.......L|.O......|
|000010b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+